<?php

namespace app\admin\validate;

use think\Validate;

class AuthRule extends Validate {

    /**
     * 规则定义
     * @var array
     */
    protected $rule = [
        'id'       => 'number',
        'page'     => 'number',
        'pageSize' => 'number',
        'name'     => 'require|min:1|max:20',
    ];

    /**
     * 提示信息定义
     * @var array
     */
    protected $message = [
        'id'       => 'ID类型为正整数',
        'page'     => '分页参数类型为正整数',
        'pageSize' => '每页展示参数为正整数',
        'name'     => '请输入1-20位菜单名称',
    ];

    /**
     * 场景定义
     * @var array
     */
    public $scene = [
        'operateAjax'      => ['name'],
    ];
}